﻿using System;
using System.Collections.ObjectModel;
using RssNewsFeeder.Model.Business;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace RssNewsFeeder.ViewModel
{
    public class NewsItemViewModel:ViewModelBase
    {        
        private NewsItemCollection _newsItemCollection;

        /// <summary>
        /// Constructor
        /// </summary>
        public NewsItemViewModel()
        {
            _newsItemCollection = new NewsItemCollection();
        }
        public NewsItemViewModel(string newsCompany, String newsType)
        {
            _newsItemCollection = new NewsItemCollection
            {
                NewsCompany = newsCompany,
                NewsType = newsType
            };
        }

        public ObservableCollection<NewsItem> NewsItemCollection
        {
            get
            {
                return new ObservableCollection<NewsItem>(_newsItemCollection.NewsItems);
            }
        }
        protected override void OnDispose()
        {
            base.OnDispose();
        }
    }
}
